package org.mybatis3.demo1;

import org.apache.ibatis.session.SqlSession;
import org.mybatis3.demo1.dao.UserMapper;
import org.mybatis3.demo1.pojo.User;
import org.mybatis3.util.MyBatisUtil;

import java.util.List;

public class Test11 {
    public static void main(String[] args) {
       SqlSession sqlSession= MyBatisUtil.getSqlSession();
//       List<User> userList= sqlSession.getMapper(UserMapper.class).searchUser(null,1L);
        List<User> userList= sqlSession.getMapper(UserMapper.class).searchUser2("员",1L);
       for (int i=0;i<userList.size();i++){
           System.out.println(userList.get(i).getUserName());
       }
       MyBatisUtil.closeSqlSession();
    }
}
